import React from "react";
import { View } from "@tarojs/components";
import Taro from "@tarojs/taro";
// import { Arrow } from "@taroify/icons";

type TRiskQueryItemProps = {
  item: {
    id: string;
    level: string;
    title: string;
    source: string;
  };
};

const RiskQueryItem: React.FC<TRiskQueryItemProps> = ({ item }) => {
  const goDetail=(item)=>{
    Taro.navigateTo({
      url: `/pages/RiskQuery/components/RiskQueryDetail/index?item=${item.id}`
    })};
  return (
    <View 
    className="w-full p-3 bg-white rounded-lg" 
    onClick={()=>goDetail(item)}
    >
      <View className="w-full mb-2 text-xs text-red-500">
        频发 已有多家企业发现
      </View>
      <View className="flex flex-row items-center w-full gap-2 flex-nowrap">
        <View className="flex flex-row items-center justify-center px-2 text-2xl text-red-400 rounded-md bg-red-50 flex-nowrap">
          {item.level}
        </View>
        <View className="flex-1 w-1">
          <View className="w-full mb-1 truncate">{item.title}</View>
          <View className="flex flex-row items-center justify-between flex-nowrap">
            <View className="text-xs text-gray-500">
              风险来源: {item.source}
            </View>
            <View className="text-xs text-gray-500">
              整改措施
              {/* <Arrow size={12} /> */}
            </View>
          </View>
        </View>
      </View>
    </View>
  );
};

export default RiskQueryItem;
